

function addSensorbitCod(Blockly) {




     //滑动电位器
  Blockly.Python.microbit_slipresistance = function(block) {
    var dropdown_slipresistance = this.getFieldValue('slipresistance');
    Blockly.Python.definitions_['import_microbit'] = 'from microbit import *\nimport math';
    Blockly.Python.definitions_['import_slidepotentiometer'] = 'from input import potentiometer\n';
    Blockly.Python.definitions_['codeLine_slidepotentiometer'] = '  slideValue = potentiometer.slide_value('+ dropdown_slipresistance +')\n  slideValue1 = slideValue/1023*100';
    var code = 'int(slideValue1)';
    return [code];
  }

    return Blockly;
}

module.exports = addSensorbitCod;

